import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class HJ27 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = "";
        while((str = br.readLine()) != null) {
            String[] arr = str.split(" ");
            int count = Integer.parseInt(arr[0]);//字典存放的单词个数
            String key = arr[count+1];//要查找的单词
            int index = Integer.parseInt(arr[count+2]);//索引
            List<String> list = new ArrayList<>();
            for(int i =1; i <= count; i++) {
                if(isBrotherWord(arr[i], key)) {
                    //是兄弟单词
                    list.add(arr[i]);
                }
            }
            Collections.sort(list);//字典排序
            System.out.println(list.size());//输出兄弟单词的个数
            if(list.size() >= index){
                System.out.println(list.get(index - 1));//输出第index个兄弟单词
            }
        }

        br.close();
    }

    //判断是否是兄弟单词
    public static boolean isBrotherWord(String source, String dest) {
        if(source.equals(dest) || (source.length() != dest.length())) {
            return false;
        }
        //先转换成char
        char[] source_ch = source.toCharArray();
        char[] dest_ch = dest.toCharArray();
        //排序
        Arrays.sort(source_ch);
        Arrays.sort(dest_ch);
        //比较排序后的单词是否相同，相同则说明是兄弟单词
        String source_sort = String.copyValueOf(source_ch);
        String dest_sort = String.copyValueOf(dest_ch);
        if(source_sort.equals(dest_sort)) {
            return true;
        }

        return false;
    }
}
